/**
 * remember me auto-login middleware.
 * require passport
*/
module.exports = function(req, res, next){
   if(req.user) return next();
   
   var rememberme_token = req.cookies._rme;
   if(!rememberme_token) return next();

   Domain.User.findOne({rememberme: rememberme_token}, function(err, user){
      if(err){
         res.clearCookie('_rme');
         return next();
      }
      req.login(user, function(err){
         return next();
      });
   });
}
